package com.hyzh.hj212.client;

import com.coffee.netty.config.ConfigManager;
import com.coffee.netty.connection.Connection;

import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author songkui
 * @since 2024/8/5 19:38
 */
public class ConnectonMananger {
    private CopyOnWriteArrayList<Connection> registers = new CopyOnWriteArrayList();

    private static final class ManagerHolder {
        static final ConnectonMananger manager = new ConnectonMananger();
    }

    public static ConnectonMananger getInstance() {
        return ConnectonMananger.ManagerHolder.manager;
    }

    public void put(Connection connection){
        registers.add(connection);
    }

    public void remove(Connection connection){
        registers.remove(connection);
    }



}
